/*
    api:"上传文件"
    name:"陈小洋"
    time：2021.2.13
* */
const tools = require('../../../tools/public');
/**
 * @api {post} /Upload/UploadImg 1.上传图片到本地服务器
 * @apiGroup Upload
 *
 * @apiParam {String} File 图片文件
 *
 *
 * @apiParamExample {json} Request-Example
 *{
 *
 *}
 * @apiSuccessExample  {json} Response-Example
 * {
 *   "code": 200,
 *   "msg": "上传成功！"
 *   }
 */
module.exports = async function (req, res, next) {
    try{
        tools.SaveImgToLocal(req,res,(e)=>{
            if(e.code===200){
                res.send(e);
            }
        })
    } catch (e) {
        console.log(e)
        return res.send(tools.ReturnData(500, '系统内部错误！'));
    }
};